<!doctype html>
<html>
<head>
  <meta charset='utf-8'>
  <title>Options - Handsontable</title>

  <!--
  Loading Handsontable (full distribution that includes all dependencies apart from jQuery)
  -->
  <script data-jsfiddle="common" src="../lib/jquery.min.js"></script>
  <script data-jsfiddle="common" src="../dist/jquery.handsontable.full.js"></script>
  <link data-jsfiddle="common" rel="stylesheet" media="screen" href="../dist/jquery.handsontable.full.css">
  <!-- the below is only needed for DateCell (uses jQuery UI Datepicker) -->
  <script data-jsfiddle="common" src="../lib/jquery-ui/js/jquery-ui.custom.min.js"></script>
  <link data-jsfiddle="common" rel="stylesheet" media="screen"
        href="../lib/jquery-ui/css/ui-bootstrap/jquery-ui.custom.css">

  <!--
  Loading demo dependencies. They are used here only to enhance the examples on this page
  -->
  <link data-jsfiddle="common" rel="stylesheet" media="screen" href="css/samples.css?20140331">
  <script src="js/samples.js"></script>
  <script src="js/highlight/highlight.pack.js"></script>
  <link rel="stylesheet" media="screen" href="js/highlight/styles/github.css">
  <link rel="stylesheet" href="css/font-awesome/css/font-awesome.min.css">

  <!--
  Facebook open graph. Don't copy this to your project :)
  -->
  <meta property="og:title" content="Options">
  <meta property="og:description"
        content="On this page you can preview the effects of various options.">
  <meta property="og:url" content="http://handsontable.com/demo/options.html">
  <meta property="og:image" content="http://handsontable.com/demo/image/og-image.png">
  <meta property="og:image:type" content="image/png">
  <meta property="og:image:width" content="409">
  <meta property="og:image:height" content="164">
  <link rel="canonical" href="http://handsontable.com/demo/options.html">

  <!--
  Google Analytics for GitHub Page. Don't copy this to your project :)
  -->
  <script src="js/ga.js"></script>
</head>

<body>


<div class="wrapper">
  <div class="wrapper-row">
    <div id="global-menu-clone">
      <h1><a href="../index.html">Handsontable</a></h1>

    </div>

    <div id="container">
      <div class="columnLayout">

        <div class="rowLayout">
      <div class="descLayout">
        <div class="pad" data-jsfiddle="example1">
          <h2>Options</h2>

          <p>
            This demo lets you play with some table options (currently only <code>pasteMode</code>, but more to come).
          </p>

          <p>
            Use the drop-down menu under the table to change Handsontable options live.
          </p>

          <div id="example1"></div>

          <p>
            <button name="dump" data-dump="#example1" title="Prints current data source to Firebug/Chrome Dev Tools">
              Dump data to console
            </button>
          </p>

          <p>
            <label><span>pasteMode</span> <select class="handsontableOption" name="pasteMode">
              <option value="overwrite">"overwrite" (default)</option>
              <option value="shift_down">"shift_down"</option>
              <option value="shift_right">"shift_right"</option>
            </select></label>
          </p>

          <p>
            <label><span>fragmentSelection</span> <select class="handsontableOption" name="fragmentSelection">
              <option value="false">false (default)</option>
              <option value="true">true</option>
            </select></label>
          </p>

          <p>
            <label><span>multiSelect:</span> <select class="handsontableOption" name="multiSelect">
              <option value="true">true (default)</option>
              <option value="false">false</option>
            </select></label>
          </p>

          <p>
            <label><span>wordWrap:</span> <select class="handsontableOption" name="wordWrap">
              <option value="true">true (default)</option>
              <option value="false">false</option>
            </select></label>
          </p>

          <p>
            <label><span>autoWrapRow:</span> <select class="handsontableOption" name="autoWrapRow">
              <option value="true">true</option>
              <option value="false" selected>false (default)</option>
            </select></label>
          </p>
        </div>
      </div>

      <div class="codeLayout">
        <div class="pad">
          <div class="jsFiddle">
            <button class="jsFiddleLink" data-runfiddle="example1">Edit in jsFiddle</button>
          </div>

          <script data-jsfiddle="example1">
            var data = [
              ["", "Maserati", "Mazda", "Mercedes-Benz", "Mini", "Mitsubishi"],
              ["2009", 0, 2941, 4303, 354, 5814],
              ["2010", 5, 2905, 2867, 412, 5284],
              ["2011", 4, 2517, 4822, 552, 6127],
              ["2012", 2, 2422, 5399, 776, 4151]
            ];

            $('#example1').handsontable({
              data: data,
              minRows: 5,
              minCols: 6,
              minSpareRows: 1,
              autoWrapRow: false,
              colHeaders: true,
              contextMenu: true,
              colWidths: 80
            });

            var HOT = $('#example1').handsontable('getInstance');

            $('.handsontableOption').change(function () {
              var update = {};
              switch (this.value) {
                case 'true':
                  update[this.name] = true;
                  break;

                case 'false':
                  update[this.name] = false;
                  break;

                default:
                  update[this.name] = this.value;
              }

              HOT.updateSettings(update);
            });
          </script>
        </div>
      </div>
    </div>

        <div class="footer-text">Handsontable &copy; 2012-2014 Marcin Warpechowski and contributors.<br> Code and documentation
          licensed under the The MIT License.
        </div>
      </div>

    </div>

  </div>
</div>

<div id="outside-links-wrapper"></div>

</body>
</html>